<?php


/*
* Copyright (c) 2008-2016 vip.com, All Rights Reserved.
*
* Powered by com.vip.osp.osp-idlc-2.5.11.
*
*/

namespace com\vip\top\carrier\bizservice;

class SubTransportNoInfo {
	
	static $_TSPEC;
	public $subTransportNo = null;
	public $boxSeq = null;
	public $twoDimensionCode = null;
	public $proCode = null;
	public $proName = null;
	public $codeMapping = null;
	
	public function __construct($vals=null){
		
		if (!isset(self::$_TSPEC)){
			
			self::$_TSPEC = array(
			1 => array(
			'var' => 'subTransportNo'
			),
			2 => array(
			'var' => 'boxSeq'
			),
			3 => array(
			'var' => 'twoDimensionCode'
			),
			4 => array(
			'var' => 'proCode'
			),
			5 => array(
			'var' => 'proName'
			),
			6 => array(
			'var' => 'codeMapping'
			),
			
			);
			
		}
		
		if (is_array($vals)){
			
			
			if (isset($vals['subTransportNo'])){
				
				$this->subTransportNo = $vals['subTransportNo'];
			}
			
			
			if (isset($vals['boxSeq'])){
				
				$this->boxSeq = $vals['boxSeq'];
			}
			
			
			if (isset($vals['twoDimensionCode'])){
				
				$this->twoDimensionCode = $vals['twoDimensionCode'];
			}
			
			
			if (isset($vals['proCode'])){
				
				$this->proCode = $vals['proCode'];
			}
			
			
			if (isset($vals['proName'])){
				
				$this->proName = $vals['proName'];
			}
			
			
			if (isset($vals['codeMapping'])){
				
				$this->codeMapping = $vals['codeMapping'];
			}
			
			
		}
		
	}
	
	
	public function getName(){
		
		return 'SubTransportNoInfo';
	}
	
	public function read($input){
		
		$input->readStructBegin();
		while(true){
			
			$schemeField = $input->readFieldBegin();
			if ($schemeField == null) break;
			$needSkip = true;
			
			
			if ("subTransportNo" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->subTransportNo);
				
			}
			
			
			
			
			if ("boxSeq" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->boxSeq);
				
			}
			
			
			
			
			if ("twoDimensionCode" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->twoDimensionCode);
				
			}
			
			
			
			
			if ("proCode" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->proCode);
				
			}
			
			
			
			
			if ("proName" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->proName);
				
			}
			
			
			
			
			if ("codeMapping" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->codeMapping);
				
			}
			
			
			
			if($needSkip){
				
				\Osp\Protocol\ProtocolUtil::skip($input);
			}
			
			$input->readFieldEnd();
		}
		
		$input->readStructEnd();
		
		
		
	}
	
	public function write($output){
		
		$xfer = 0;
		$xfer += $output->writeStructBegin();
		
		$xfer += $output->writeFieldBegin('subTransportNo');
		$xfer += $output->writeString($this->subTransportNo);
		
		$xfer += $output->writeFieldEnd();
		
		$xfer += $output->writeFieldBegin('boxSeq');
		$xfer += $output->writeString($this->boxSeq);
		
		$xfer += $output->writeFieldEnd();
		
		if($this->twoDimensionCode !== null) {
			
			$xfer += $output->writeFieldBegin('twoDimensionCode');
			$xfer += $output->writeString($this->twoDimensionCode);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->proCode !== null) {
			
			$xfer += $output->writeFieldBegin('proCode');
			$xfer += $output->writeString($this->proCode);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->proName !== null) {
			
			$xfer += $output->writeFieldBegin('proName');
			$xfer += $output->writeString($this->proName);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->codeMapping !== null) {
			
			$xfer += $output->writeFieldBegin('codeMapping');
			$xfer += $output->writeString($this->codeMapping);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		$xfer += $output->writeFieldStop();
		$xfer += $output->writeStructEnd();
		return $xfer;
	}
	
}

?>